package com.ranchuanyin.schoolcat.controller;

import com.ranchuanyin.schoolcat.service.CatUserFriendService;
import com.ranchuanyin.schoolcat.units.RestBean;
import com.ranchuanyin.schoolcat.vo.FriendVO;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/cat/message")
public class MessageController {
    @Resource
    CatUserFriendService catUserFriendService;

    @GetMapping("/getFriendList/{id}")
    public RestBean<List<FriendVO>> getFriendList(@PathVariable String id) {
        List<FriendVO> friendList = catUserFriendService.getFriendList(Long.valueOf(id));
        return RestBean.success(friendList);
    }
}
